package com.twu.biblioteca.view.consoleUI.viewActions;

import com.twu.biblioteca.view.ViewAction;

import java.io.PrintStream;

public class CheckoutViewAction implements ViewAction {

    private final PrintStream output;
    private final String typeName;

    public CheckoutViewAction(PrintStream output, Class type) {
        this.output = output;
        this.typeName = type.getSimpleName();
    }

    @Override
    public void update(boolean success) {
        if (success)
            output.println("Thank you! Enjoy the " + typeName + ".");
        else
            output.println("That " + typeName + " is Not Available.");
    }

}
